var vcity={ 11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",  
            21:"辽宁",22:"吉林",23:"黑龙江",31:"上海",32:"江苏",  
            33:"浙江",34:"安徽",35:"福建",36:"江西",37:"山东",41:"河南",  
            42:"湖北",43:"湖南",44:"广东",45:"广西",46:"海南",50:"重庆",  
            51:"四川",52:"贵州",53:"云南",54:"西藏",61:"陕西",62:"甘肃",  
            63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外"};  
_YTG_IOSorANDROID = {
		systemJudge: function(){
	        var systemFlag = "";
			var u = navigator.userAgent;
			var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
			var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
			if(isAndroid){
				systemFlag = 'Android';
			}else if(isiOS){
				systemFlag = 'IOS';
			}
			return systemFlag;
		}
}

_YHC_isWEIXIN = {
		isWeiXin: function(){
			var ua = window.navigator.userAgent.toLowerCase();
		    if(ua.match(/MicroMessenger/i) == 'micromessenger'){
		        return true;
		    }else{
		        return false;
		    }
		}
}


_YHC_util = {
		//身份证号合法性验证
		//支持15位和18位身份证号
		//支持地址编码、出生日期、校验位验证
		IdentityCodeValid:function(card)  
		{  
		    //是否为空  
		    if(card === '')  
		    {  
		        return false;  
		    }  
		    //校验长度，类型  
		    if(this.isCardNo(card) === false)  
		    {  
		        return false;  
		    }  
		    //检查省份  
		    if(this.checkProvince(card) === false)  
		    {   
		        return false;  
		    }  
		    //校验生日  
		    if(this.checkBirthday(card) === false)  
		    {  
		        return false;  
		    }  
		    //检验位的检测  
		    if(this.checkParity(card) === false)  
		    {  
		        return false;  
		    }   
		    return true;  
		},
		  
		  
		//检查号码是否符合规范，包括长度，类型  
		isCardNo:function(card)  
		{  
		    //身份证号码为15位或者18位，15位时全为数字，18位前17位为数字，最后一位是校验位，可能为数字或字符X  
		    var reg = /(^\d{15}$)|(^\d{17}(\d|X)$)/;  
		    if(reg.test(card) === false)  
		    {  
		        return false;  
		    }  
		  
		    return true;  
		}, 
		
		
		//Luhm校验规则：16位银行卡号（19位通用）:
		// 1.将未带校验位的 15（或18）位卡号从右依次编号 1 到 15（18），位于奇数位号上的数字乘以 2。
		// 2.将奇位乘积的个十位全部相加，再加上所有偶数位上的数字。
		// 3.将加法和加上校验位能被 10 整除。
		//bankno为银行卡号 banknoInfo为显示提示信息的DIV或其他控件
		luhmCheck:function(bankno){
		    var lastNum=bankno.substr(bankno.length-1,1);//取出最后一位（与luhm进行比较）
		 
		    var first15Num=bankno.substr(0,bankno.length-1);//前15或18位
		    var newArr=new Array();
		    for(var i=first15Num.length-1;i>-1;i--){    //前15或18位倒序存进数组
		        newArr.push(first15Num.substr(i,1));
		    }
		    var arrJiShu=new Array();  //奇数位*2的积 <9
		    var arrJiShu2=new Array(); //奇数位*2的积 >9
		     
		    var arrOuShu=new Array();  //偶数位数组
		    for(var j=0;j<newArr.length;j++){
		        if((j+1)%2==1){//奇数位
		            if(parseInt(newArr[j])*2<9)
		            arrJiShu.push(parseInt(newArr[j])*2);
		            else
		            arrJiShu2.push(parseInt(newArr[j])*2);
		        }
		        else //偶数位
		        arrOuShu.push(newArr[j]);
		    }
		     
		    var jishu_child1=new Array();//奇数位*2 >9 的分割之后的数组个位数
		    var jishu_child2=new Array();//奇数位*2 >9 的分割之后的数组十位数
		    for(var h=0;h<arrJiShu2.length;h++){
		        jishu_child1.push(parseInt(arrJiShu2[h])%10);
		        jishu_child2.push(parseInt(arrJiShu2[h])/10);
		    }        
		     
		    var sumJiShu=0; //奇数位*2 < 9 的数组之和
		    var sumOuShu=0; //偶数位数组之和
		    var sumJiShuChild1=0; //奇数位*2 >9 的分割之后的数组个位数之和
		    var sumJiShuChild2=0; //奇数位*2 >9 的分割之后的数组十位数之和
		    var sumTotal=0;
		    for(var m=0;m<arrJiShu.length;m++){
		        sumJiShu=sumJiShu+parseInt(arrJiShu[m]);
		    }
		     
		    for(var n=0;n<arrOuShu.length;n++){
		        sumOuShu=sumOuShu+parseInt(arrOuShu[n]);
		    }
		     
		    for(var p=0;p<jishu_child1.length;p++){
		        sumJiShuChild1=sumJiShuChild1+parseInt(jishu_child1[p]);
		        sumJiShuChild2=sumJiShuChild2+parseInt(jishu_child2[p]);
		    }      
		    //计算总和
		    sumTotal=parseInt(sumJiShu)+parseInt(sumOuShu)+parseInt(sumJiShuChild1)+parseInt(sumJiShuChild2);
		     
		    //计算Luhm值
		    var k= parseInt(sumTotal)%10==0?10:parseInt(sumTotal)%10;        
		    var luhm= 10-k;
		     
		    if (lastNum == luhm && lastNum.length != 0) {
	            return true;
	        } else {
	            return false;
	        }      
		},
		
		  
		//取身份证前两位,校验省份  
		checkProvince:function(card)  
		{  
		    var province = card.substr(0,2);  
		    if(vcity[province] == undefined)  
		    {  
		        return false;  
		    }  
		    return true;  
		},  
		  
		//检查生日是否正确  
		checkBirthday:function(card)  
		{  
		    var len = card.length;  
		    //身份证15位时，次序为省（3位）市（3位）年（2位）月（2位）日（2位）校验位（3位），皆为数字  
		    if(len == '15')  
		    {  
		        var re_fifteen = /^(\d{6})(\d{2})(\d{2})(\d{2})(\d{3})$/;   
		        var arr_data = card.match(re_fifteen);  
		        var year = arr_data[2];  
		        var month = arr_data[3];  
		        var day = arr_data[4];  
		        var birthday = new Date('19'+year+'/'+month+'/'+day);  
		        return this.verifyBirthday('19'+year,month,day,birthday);  
		    }  
		    //身份证18位时，次序为省（3位）市（3位）年（4位）月（2位）日（2位）校验位（4位），校验位末尾可能为X  
		    if(len == '18')  
		    {  
		        var re_eighteen = /^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})([0-9]|X)$/;  
		        var arr_data = card.match(re_eighteen);  
		        var year = arr_data[2];  
		        var month = arr_data[3];  
		        var day = arr_data[4];  
		        var birthday = new Date(year+'/'+month+'/'+day);  
		        return this.verifyBirthday(year,month,day,birthday);  
		    }  
		    return false;  
		},  
		  
		//校验日期  
		verifyBirthday:function(year,month,day,birthday)  
		{  
		    var now = new Date();  
		    var now_year = now.getFullYear();  
		    //年月日是否合理  
		    if(birthday.getFullYear() == year && (birthday.getMonth() + 1) == month && birthday.getDate() == day)  
		    {  
		        //判断年份的范围（3岁到100岁之间)  
		        var time = now_year - year;  
		        if(time >= 3 && time <= 100)  
		        {  
		            return true;  
		        }  
		        return false;  
		    }  
		    return false;  
		},  
		  
		//校验位的检测  
		checkParity:function(card)  
		{  
		    //15位转18位  
		    card = this.changeFivteenToEighteen(card);  
		    var len = card.length;  
		    if(len == '18')  
		    {  
		        var arrInt = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2);   
		        var arrCh = new Array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2');   
		        var cardTemp = 0, i, valnum;   
		        for(i = 0; i < 17; i ++)   
		        {   
		            cardTemp += card.substr(i, 1) * arrInt[i];   
		        }   
		        valnum = arrCh[cardTemp % 11];   
		        if (valnum == card.substr(17, 1))   
		        {  
		            return true;  
		        }  
		        return false;  
		    }  
		    return false;  
		},  
		  
		//15位转18位身份证号  
		changeFivteenToEighteen:function(card)  
		{  
		    if(card.length == '15')  
		    {  
		        var arrInt = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2);   
		        var arrCh = new Array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2');   
		        var cardTemp = 0, i;     
		        card = card.substr(0, 6) + '19' + card.substr(6, card.length - 6);  
		        for(i = 0; i < 17; i ++)   
		        {   
		            cardTemp += card.substr(i, 1) * arrInt[i];   
		        }   
		        card += arrCh[cardTemp % 11];   
		        return card;  
		    }  
		    return card;  
		},
		
		//将字符串变成数组
    	 strToArr : function(str){
    		var tempData = new Array();
    		if(str.length > 0){
    			for(var i=0;i<str.length;i++){
    				tempData.push(str[i]);
    			}
    		}
    		var tempLength = 6 - tempData.length;
    		for(var i=0;i<tempLength;i++){
    			tempData.push("");
    		}
    		return tempData;
    	},
    	
    	//hasClass
    	hasClass : function(elem, cls){
    	    cls = cls || '';
    	    if(cls.replace(/\s/g, '').length == 0) return false;
    	    return new RegExp(' ' + cls + ' ').test(' ' + elem.className + ' ');
    	},
    	
    	//addClass
        addClass : function(elem, cls){
    	    if(!this.hasClass(elem, cls)){
    	        elem.className += ' ' + cls;
    	    }
    	},
    	
    	//removeClass
    	removeClass : function(elem, cls){
    	    if(this.hasClass(elem, cls)){
    	        var newClass = ' ' + elem.className.replace(/[\t\r\n]/g, '') + ' ';
    	        while(newClass.indexOf(' ' + cls + ' ') >= 0){
    	            newClass = newClass.replace(' ' + cls + ' ', ' ');
    	        }
    	        elem.className = newClass.replace(/^\s+|\s+$/g, '');
    	    }
    	},
    	
    	/*验证营业执照是否合法：营业执照长度须为15位数字，前14位为顺序码，
    	*最后一位为根据GB/T 17710 1999(ISO 7064:1993)的混合系统校验位生成算法
    	*计算得出。此方法即是根据此算法来验证最后一位校验位是否政正确。如果
    	*最后一位校验位不正确，则认为此营业执照号不正确(不符合编码规则)。*/
    	 isValidBusCode: function(busCode){
            return true;
//            var ret=false;
//            if(busCode.length==15){
//                var sum=0;
//                var s=[];
//                var p=[];
//                var a=[];
//                var m=10;
//                p[0]=m;
//                for(var i=0;i<busCode.length;i++){
//                   a[i]=parseInt(busCode.substring(i,i+1),m);
//                   s[i]=(p[i]%(m+1))+a[i];
//                   if(0==s[i]%m){
//                     p[i+1]=10*2;
//                   }else{
//                     p[i+1]=(s[i]%m)*2;
//                    }    
//                }                                       
//                if(1==(s[14]%m)){
//                   //营业执照编号正确!
//                    ret=true;
//                }else{
//                   //营业执照编号错误!
//                    ret=false;
//                 }
//            }//如果营业执照为空
//            else if(""==busCode){
//                ret=false;
//            }else{
//                ret=false;
//            }
//            return ret;
        },
        
        /**
        *验证组织机构代码是否合法：组织机构代码为8位数字或者拉丁字母+“-”+1位校验码。
        *验证最后那位校验码是否与根据公式计算的结果相符。
        *编码规则请参看
        *http://wenku.baidu.com/view/d615800216fc700abb68fc35.html
        */
        isValidOrgCode: function(orgCode){
           //return ""==orgCode || orgCode.length==10;
           //return true;
           var ret=false;
           var codeVal = ["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];
           var intVal =    [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35];
           var crcs =[3,7,9,10,5,8,4,2];
           if(!(""==orgCode) && orgCode.length==10){
              var sum=0;
              for(var i=0;i<8;i++){
                 var codeI=orgCode.substring(i,i+1);
                 var valI=-1;
                 for(var j=0;j<codeVal.length;j++){
                     if(codeI==codeVal[j]){
                        valI=intVal[j];
                        break;
                     }
                 }
                 sum+=valI*crcs[i];
              }
              var crc=11- (sum%11);
                       
              switch (crc){
                           case 10:{
                               crc="X";
                               break;
                           }default:{
                               break;
                           }
                       }
              //最后位验证码正确
              if(crc==orgCode.substring(9)){
                   ret=true;
              }else{
                   ret=false;
              }
           }else if(""==orgCode){
               ret=false;
           }else{
               ret=false;
           }
           return ret;
        },
        
        //邮箱验证
        fChkMail: function(mail){ 
        	var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/; 
        	return reg.test(mail); 
        }
}

_SYT_util = {
	/**
	 * 格式化金额
	 * 
	 * @param money
	 *            金额
	 * @param accuracy
	 *            精度(小数位数)
	 * @return 格式化后的金额
	 */

    isErrorAmount: function (input) {
        if (/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(input + '')) {
            return false;
        } else {
            return true;
        }
    },
	formatMoney : function(money, accuracy) {
		if (money == null || money == "") {
			return money;
		}
		money = money + "";
		var tempValue = money.replace(/\s/g, "");
		var tempArray = null;
		var v = "";
		// 如果为整数
		if (accuracy <= 0) {
			if (tempValue.indexOf(".") != -1) {
				v = tempValue.split(".")[0];
			} else {
				v = tempValue;
			}
		}
		// 如果为小数
		else {
			if (tempValue.indexOf(".") != -1) {
				tempArray = tempValue.split(".");
				v = tempArray[0]
						+ "."
						+ (tempArray[1] + "00000000000000000").substring(0,
								accuracy);
			} else {
				v = tempValue + "."
						+ ("00000000000000000").substring(0, accuracy);
			}
		}
		return v;
	},

	/**
	 * 格式化日期
	 * 
	 * @param date
	 *            日期
	 * @param format
	 *            格式化样式,例如yyyy-MM-dd HH:mm:ss E
	 * @return 格式化后的金额
	 */
	formatDate : function(date, format) {
		var v = "";
		if (typeof date == "string" || typeof date != "object") {
			return;
		}
		var year = date.getFullYear();
		var month = date.getMonth() + 1;
		var day = date.getDate();
		var hour = date.getHours();
		var minute = date.getMinutes();
		var second = date.getSeconds();
		var weekDay = date.getDay();
		var ms = date.getMilliseconds();
		var weekDayString = "";

		if (weekDay == 1) {
			weekDayString = "星期一";
		} else if (weekDay == 2) {
			weekDayString = "星期二";
		} else if (weekDay == 3) {
			weekDayString = "星期三";
		} else if (weekDay == 4) {
			weekDayString = "星期四";
		} else if (weekDay == 5) {
			weekDayString = "星期五";
		} else if (weekDay == 6) {
			weekDayString = "星期六";
		} else if (weekDay == 7) {
			weekDayString = "星期日";
		}

		v = format;
		// Year
		v = v.replace(/yyyy/g, year);
		v = v.replace(/YYYY/g, year);
		v = v.replace(/yy/g, (year + "").substring(2, 4));
		v = v.replace(/YY/g, (year + "").substring(2, 4));

		// Month
		var monthStr = ("0" + month);
		v = v.replace(/MM/g, monthStr.substring(monthStr.length - 2));

		// Day
		var dayStr = ("0" + day);
		v = v.replace(/dd/g, dayStr.substring(dayStr.length - 2));

		// hour
		var hourStr = ("0" + hour);
		v = v.replace(/HH/g, hourStr.substring(hourStr.length - 2));
		v = v.replace(/hh/g, hourStr.substring(hourStr.length - 2));

		// minute
		var minuteStr = ("0" + minute);
		v = v.replace(/mm/g, minuteStr.substring(minuteStr.length - 2));

		// Millisecond
		v = v.replace(/sss/g, ms);
		v = v.replace(/SSS/g, ms);

		// second
		var secondStr = ("0" + second);
		v = v.replace(/ss/g, secondStr.substring(secondStr.length - 2));
		v = v.replace(/SS/g, secondStr.substring(secondStr.length - 2));

		// weekDay
		v = v.replace(/E/g, weekDayString);
		return v;
	},

	formatDateTimeString : function(dateTimeString) {
		if (dateTimeString == null || dateTimeString == "") {
			return "";
		}
		dateTimeString = dateTimeString.replace(/ /g, "");
		dateTimeString = dateTimeString.replace(/\-/g, "");
		dateTimeString = dateTimeString.replace(/\:/g, "");
		var year = dateTimeString.substring(0, 4);
		var month = dateTimeString.substring(4, 6);
		var day = dateTimeString.substring(6, 8);
		var hour = dateTimeString.substring(8, 10);
		var minute = dateTimeString.substring(10, 12);
		var second = dateTimeString.substring(12, 14);

		var newString = "";
		if (year != "") {
			newString += year;
		}
		if (month != "") {
			newString += "-" + month;
		}
		if (day != "") {
			newString += "-" + day;
		}
		if (hour != "") {
			newString += " " + hour;
		}
		if (minute != "") {
			newString += ":" + minute;
		}
		if (second != "") {
			newString += ":" + second;
		}
		return newString;
	},
	
	formatDateToString : function(){
		var myDate = new Date();
		var month = myDate.getMonth()*1 + 1;
		if(month < 10){
			month = "0" + month;
		}
		var dateString = myDate.getFullYear() + "" +  month + "" + myDate.getDate() + "" + myDate.getHours() + "" + "0000";
		return dateString;
	},

	/**
	 * 转化日期
	 * 
	 * @param dependedVal
	 *            string 日期 yyyy-MM-dd
	 * @return date
	 */
	datestrToDate : function(dependedVal) {
		var regEx = new RegExp("\\-", "gi");
		dependedVal = dependedVal.replace(regEx, "/");
		var milliseconds = Date.parse(dependedVal);
		var dependedDate = new Date();
		dependedDate.setTime(milliseconds);
		return dependedDate;
	},
	
	/**
	 * 比较两日期大小
	 * 
	 * @param dependedVal
	 * string 日期 yyyy-MM-dd
	 * startData
	 * endData   
	 * @return boolean
	 */
	compareDate : function(startData,endData) {
		var startTime = startData.replace(/-/g,"/");
		var endTime = endData.replace(/-/g,"/");
		var d1 = new Date(Date.parse(startTime)); 
		var d2 = new Date(Date.parse(endTime)); 
		if(d1>d2) {
			return false;
		}else{
			return true;
		}
	},
    
    
    /**
	 * 验证是手机号是否有效
	 * @param mobileNo 充值手机号
	 * @return boolean true 
	 */
    isValidNo : function(mobileNo){
		var v = false;
		if(mobileNo == null || mobileNo == "" || mobileNo.length != 11) {
			return false;
		}
//		var mobileHead = mobileNo.substr(0,3);
//		var headArray = new Array(134,135,136,137,138,139,150,151,152,157,158,159,182,183,187,188,147,130,131,132,155,156,185,186,133,153,180,189,181);
//        for(var i=0;i<headArray.length;i++){
//           if(headArray[i] == mobileHead) {
//              v = true;
//              break;
//           }
//        }
		var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1})|(14[0-9]{1}))+\d{8})$/;
        if(myreg.test(mobileNo)){
        	v = true;
        }
		return v;
	},
	
	/* 
	用途：检查输入字符串是否只由汉字、字母组成 
	输入： 
	value：字符串 
	返回： 
	如果通过验证返回true,否则返回false 
	*/
	//判断姓名是否是汉字、字母组成 
	isChinaOrLett: function(s){
		var flag;
    	var regu = "^[a-zA-Z\u4e00-\u9fa5]+$"; 
    	var re = new RegExp(regu); 
    	if (re.test(s)) { 
    		flag = true;
    	}else{ 
    		flag = false;
    	} 
    	return flag;
	},
	
	//1.js验证只能输入6位数字.
	checkSixCode: function(value){
		var flag = false;
	    //定义正则表达式部分
		if(value == null || value == "" || value.length != 6){
			return false;
		}
	    if(/^[0-9]*$/.test(value *1)){
	    	flag = true;
        }
	    return flag;
	},
	
	math : {
		// 加法精确计算(可传负数做减法计算)
		accAdd : function(arg1, arg2) {
			var r1, r2, m, c;
			try {
				r1 = arg1.toString().split(".")[1].length;
			} catch (e) {
				r1 = 0;
			}
			try {
				r2 = arg2.toString().split(".")[1].length;
			} catch (e) {
				r2 = 0;
			}

			c = Math.abs(r1 - r2);
			m = Math.pow(10, Math.max(r1, r2))
			if (c > 0) {
				var cm = Math.pow(10, c);
				if (r1 > r2) {
					arg1 = Number(arg1.toString().replace(".", ""));
					arg2 = Number(arg2.toString().replace(".", "")) * cm;
				} else {
					arg1 = Number(arg1.toString().replace(".", "")) * cm;
					arg2 = Number(arg2.toString().replace(".", ""));
				}
			} else {
				arg1 = Number(arg1.toString().replace(".", ""));
				arg2 = Number(arg2.toString().replace(".", ""));
			}
			return (arg1 + arg2) / m;

		},
		
		// 减精确计算
		accSub : function(arg1, arg2) {
			var r1, r2, m, c;
			try {
				r1 = arg1.toString().split(".")[1].length;
			} catch (e) {
				r1 = 0;
			}
			try {
				r2 = arg2.toString().split(".")[1].length;
			} catch (e) {
				r2 = 0;
			}

			c = Math.abs(r1 - r2);
			m = Math.pow(10, Math.max(r1, r2))
			if (c > 0) {
				var cm = Math.pow(10, c);
				if (r1 > r2) {
					arg1 = Number(arg1.toString().replace(".", ""));
					arg2 = Number(arg2.toString().replace(".", "")) * cm;
				} else {
					arg1 = Number(arg1.toString().replace(".", "")) * cm;
					arg2 = Number(arg2.toString().replace(".", ""));
				}
			} else {
				arg1 = Number(arg1.toString().replace(".", ""));
				arg2 = Number(arg2.toString().replace(".", ""));
			}
			return (arg1 - arg2) / m;

		},

		// 乘法精确计算
		accMul : function(arg1, arg2) {
			var m = 0, s1 = arg1.toString(), s2 = arg2.toString();
			try {
				m += s1.split(".")[1].length;
			} catch (e) {
			}
			try {
				m += s2.split(".")[1].length;
			} catch (e) {
			}
			return Number(s1.replace(".", "")) * Number(s2.replace(".", ""))
					/ Math.pow(10, m);

		},

		// 除法函数，用来得到精确的除法结果
		accDiv : function(arg1, arg2) {
			var t1 = 0, t2 = 0, r1, r2;
			try {
				t1 = arg1.toString().split(".")[1].length;
			} catch (e) {
			}
			try {
				t2 = arg2.toString().split(".")[1].length;
			} catch (e) {
			}
			with (Math) {
				r1 = Number(arg1.toString().replace(".", ""));
				r2 = Number(arg2.toString().replace(".", ""));
				return (r1 / r2) * pow(10, t2 - t1);
			}

		}
	},
	
	 /**
	 * 根据身份证还判断年龄性别以及年龄段（青年：40岁以下,中年：41-65岁,老年:66岁以上）
	 * @param idNo 身份证号
	 */
	 analysisId : function(val){
		if(val == "" || val == null || val == 'undefined'){
			return "";
		}
		 var birthdayValue;
		 var sexual;
		if(15 == val.length){ //15位身份证号码
			birthdayValue = val.charAt(6)+val.charAt(7);
			if(parseInt(birthdayValue)<10){
				birthdayValue = '20'+birthdayValue;
			}else{
				birthdayValue = '19'+birthdayValue;
			}
			birthdayValue=birthdayValue+'-'+val.charAt(8)+val.charAt(9)+'-'+val.charAt(10)+val.charAt(11);
			if(parseInt(val.charAt(14)/2)*2!=val.charAt(14)){
				sexual = 'man';
			}else{
				sexual = 'woman';
			}
		}
		if(18 == val.length){ //18位身份证号码
			birthdayValue=val.charAt(6)+val.charAt(7)+val.charAt(8)+val.charAt(9)+'-'+val.charAt(10)+val.charAt(11)+'-'+val.charAt(12)+val.charAt(13);
			if(parseInt(val.charAt(16)/2)*2!=val.charAt(16)){
				sexual = 'man';
			}else{
				sexual = 'woman';
			}
		}
		var ageGroup = this.ageGroups(birthdayValue);
		var returnData = {};
		returnData.sex = sexual;
		returnData.type = ageGroup;
		
		return returnData;
	},
	
	ageGroups : function(str){
		//获取年龄
		var r = str.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/);
		var age,ageGroup;
        if(r == null){
        	return false;    
        } 
        var d = new Date(r[1],r[3]-1,r[4]);     
        if(d.getFullYear() == r[1]&&(d.getMonth()+1) == r[3]&&d.getDate()==r[4]){   
              var Y =new Date().getFullYear();   
              age = Y-r[1];   
        }
        //年龄段
        if(age <= 40 ){
        	ageGroup = 'young';
        }else if(age >= 66){
        	ageGroup = 'old';
        }else{
        	ageGroup = 'middleAge';
        }
        return ageGroup;
	},
	
	 getRad: function (d){
        return d*Math.PI/180.0;
    },
    
    /**
     * 经纬度距离计算
     * caculate the great circle distance
     * @param {Object} lat1
     * @param {Object} lng1
     * @param {Object} lat2
     * @param {Object} lng2
     */
   getGreatCircleDistance : function (lat1,lng1,lat2,lng2){
    	var EARTH_RADIUS = 6378137;    //单位米
    
        var radLat1 = this.getRad(lat1);
        var radLat2 = this.getRad(lat2);
        
        var a = radLat1 - radLat2;
        var b = this.getRad(lng1) - this.getRad(lng2);
        
        var s = 2*Math.asin(Math.sqrt(Math.pow(Math.sin(a/2),2) + Math.cos(radLat1)*Math.cos(radLat2)*Math.pow(Math.sin(b/2),2)));
        s = s*EARTH_RADIUS;
        s = Math.round(s*10000)/10000.0;
                
        return s;
    }
};


Array.prototype.contains = function(elem) {
	for (var i = 0; i < this.length; i++) {
		if (this[i] == elem) {
			return true;
		}
	}
	return false;
}

/**
 * 跳转到错误信息页面(根据传的参数记录日志)
 * 
 * @param operate
 *            错误信息(英文) 可选项
 * @param errorCode
 *            错误代码
 * @param extMsg
 *            错误扩展信息 可选项
 * @param extCode
 *            错误扩展代码 可选项
 * @param redirectUrl
 *            返回页面 可选项
 * @return void
 */
function _GoError(operate, errorCode, extMsg, extCode, redirectUrl) {
	errorCode = (errorCode == null) ? "" : errorCode;
	extMsg = (extMsg == null) ? "" : extMsg;
	extCode = (extCode == null) ? "" : extCode;
	redirectUrl = (redirectUrl == null) ? "" : redirectUrl;

	if (extMsg != "" && extCode != "") {
		extMsg = extMsg + "[" + extCode + "]";
	}

	console.log(operate + errorCode + extMsg);
	// window.location = _URL.error + "?errorCode=" + errorCode + "&extMsg=" +
	// encodeURIComponent(extMsg) + "&redirectUrl=" +
	// encodeURIComponent(redirectUrl);
}
var locationCityInfo = {cityCode:289,cityName:"",detCityName:"",district:""};
function setLocationCityInfo(lat,lon,cityCode,proName,cityName,district){
    console.log(lat,lon,cityCode,proName,cityName,district)
    locationCityInfo.lat = lat;
    locationCityInfo.lon = lon;
    if(cityName != "" && cityName != null && cityName != 'null'){
        locationCityInfo.cityName = cityName;
        locationCityInfo.detCityName = cityName;
        locationCityInfo.district = district;
    }else{
        locationCityInfo.cityName = "";
        locationCityInfo.detCityName = "";
        locationCityInfo.district = "";
    }

}
var _fire_eleSorollToTarget=function(eleQuery,targetScrollTop,target_time){
	target_time=target_time/10
	//根据过焦点的抛物线函数得出时间下的距离
	var _hz_eleSorollToTarget_start= document.querySelector(eleQuery).scrollTop;
	var _hz_eleSorollToTarget_k=(_hz_eleSorollToTarget_start-targetScrollTop)/Math.pow(target_time,2);
	var _hz_eleSorollToTargetTime=null,_hz_eleSorollToTargetRuntime=target_time;
	function _hz_eleSorollToTarget_Timeout(){
		clearTimeout(_hz_eleSorollToTargetTime);
		_hz_eleSorollToTargetTime=setTimeout(function(){
			_hz_eleSorollToTargetRuntime--;
			document.querySelector(eleQuery).scrollTop=_hz_eleSorollToTarget_k*Math.pow(_hz_eleSorollToTargetRuntime,2)+targetScrollTop;
			//y=k*x2+b
			if(_hz_eleSorollToTargetRuntime==0){
				clearTimeout(_hz_eleSorollToTargetTime);
			}else{
				_hz_eleSorollToTarget_Timeout()
			}
		},10)
	}
	_hz_eleSorollToTarget_Timeout();
};
